package com.travel.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.travel.base.BaseDao;
import com.travel.base.impl.BaseServiceImpl;
import com.travel.bean.User;
import com.travel.service.LoginService;
@Service("loginServiceImpl")
public class LoginServiceImpl extends BaseServiceImpl<User> implements LoginService {

	@Autowired
	@Qualifier("loginDao")
	private BaseDao baseDao;
	@Override
	public BaseDao<User> getBaseDao() {
		// TODO Auto-generated method stub
		return this.baseDao;
	}


	@Override
	public void register(User user) {
		// TODO Auto-generated method stub
		this.getBaseDao().saveEntry(user);
		
	}

	@Override
	public User login(String phone, String password) {
		// TODO Auto-generated method stub
		Map map=new HashMap();
		map.put("phone", phone);
		map.put("pwd", password);
		return this.getBaseDao().queryEntryByProperty(map);
	}

}
